<template>
<div>
<!--编写请假的表单-->
  <el-form :inline="true" :model="leaveForm" class="demo-form-inline">
    <el-form-item label="请假人">
      <el-input v-model="leaveForm.username" placeholder="请假人"></el-input>
    </el-form-item>
    <el-form-item label="请假天数">
      <el-input v-model="leaveForm.holiday" placeholder="请假天数"></el-input>
    </el-form-item>
    <el-form-item label="请假原因">
      <el-input v-model="leaveForm.cause" placeholder="请假原因"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">提交申请</el-button>
    </el-form-item>
  </el-form>

</div>
</template>

<script>
export default {
  name: "LeaveView",
  data(){
    return{
      leaveForm: {
        username: '',
        holiday: '',
        cause:''
      }
    }
  },
  methods:{
    onSubmit(){
      this.axios.post("http://127.0.0.1:8083/ask4Leave",this.leaveForm).then(res=>{
        alert("submit success!!!!")
      })
    }
  }
}
</script>

<style scoped>

</style>